"use strict";
import * as React from 'react';
const { View, ScrollView, TouchableOpacity } = require('react-native');
const { connect } = require('react-redux');
import NavigationBar from 'react-native-navbar';
import { commonProps, commonStyles } from "../../assets/styles/common";
import { Actions } from "react-native-router-flux";
import MyText from "../../component/MyText";
import NavBackButton from "../../component/BackButton";
import Colors from "../../assets/styles/Colors";
const { List, InputItem, DatePicker } = require('antd-mobile');
class PlaceExtraIntroducePage extends React.Component {
    constructor(props, context) {
        super(props, context);
        this.renderButton = () => {
            if (this.props.data.button) {
                return (<TouchableOpacity style={[commonStyles.centerVH, { backgroundColor: Colors.Active, padding: 15 }]} onPress={() => {
                    if (this.props.data.target) {
                        Actions.push(this.props.data.target);
                    }
                }}>
                    <MyText color={Colors.White}>{this.props.data.button}</MyText>
                </TouchableOpacity>);
            }
            return null;
        };
        this.state = {
            firstName: null,
            lastName: null,
            date: new Date()
        };
    }
    render() {
        return (<View style={commonStyles.container}>
                <NavigationBar {...commonProps.navBar} leftButton={<NavBackButton />} title={{ title: this.props.title, tintColor: '#fff' }}/>
                <View style={[commonStyles.flex1, { paddingTop: 10 }]}>
                    <ScrollView>
                        <View style={{ padding: 10, display: 'flex', flex: 1 }}>
                            <MyText fontSize={15} color={Colors.Brief} style={{ lineHeight: 18 }}>{this.props.data.content}</MyText>
                        </View>

                    </ScrollView>
                    {this.renderButton()}
                </View>
            </View>);
    }
}
export default PlaceExtraIntroducePage;
